//
//  BSXPFTableViewController.m
//  BaiSiBuDeJie
//
//  Created by XPF on 16/8/29.
//  Copyright © 2016年 tsaievan. All rights reserved.
//

#import "BSXPFTableViewController.h"
#import "BSXPFThroughModel.h"
#import "BSXPFTableViewCell.h"

static NSString *BSXPFTableCell = @"BSXPFTableCell";

@interface BSXPFTableViewController ()

@end

@implementation BSXPFTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tableView.estimatedRowHeight = 200;
    
    self.tableView.rowHeight = UITableViewAutomaticDimension;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    BSBaseModel *model = self.model;

    return model.list.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    BSXPFTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:BSXPFTableCell];
    
    if (cell == nil) {
        
        cell = [[BSXPFTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:BSXPFTableCell];
        
    }
    
    
    ListModel *model = self.model.list[indexPath.row];
    
//    BSBaseModel *model = self.model;
    
    cell.model = model;
    
    
    
    return cell;
    
}

//- (void)setModelArr:(NSArray *)modelArr{
//    
//    _modelArr = modelArr;
//    
////    [self.tableView reloadData];
//    
//}

//-(void)setModel:(BSBaseModel *)model{
//    
//    _model = model;
//    
//    [self.tableView reloadData];
//    
//}

@end
